<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<title>详情</title>
  <link rel="stylesheet" href="../../../layui/css/layui.css">
  <script src="../../../layui/layui.js"></script>
    <script type="text/javascript" src="../../../js/jquery-2.1.1.min.js"></script>
    <script type="text/javascript" src="../../../js/main.js"></script>
    <link rel="stylesheet" href="../../../js/zyupload/skins/zyupload-1.0.0.min.css " type="text/css">
    <script type="text/javascript" src="../../../js/zyupload/zyupload-1.0.0.min.js"></script>
    <script type="text/javascript" src="../../../js/url.js"></script>
</head>
<style type="text/css">
 body{
  height: 100%;
  width: 100%;
 }
 .layui-form-label{width: 130px}
 .btn {
    background-color: #e5e5e5;
    background-image: none;
    filter: none;
    border: 0;
    padding: 7px 14px;
    text-shadow: none;
    font-family: "Segoe UI", Helvetica, Arial, sans-serif;
    font-size: 14px;
    color: #333333;
    cursor: pointer;
    outline: none;
    -webkit-box-shadow: none !important;
    -moz-box-shadow: none !important;
    box-shadow: none !important;
    -webkit-border-radius: 0 !important;
    -moz-border-radius: 0 !important;
    border-radius: 0 !important;
}

 .type1 {
     padding: 9px 15px;
     line-height: 20px;
 }

 .type2 {
     margin: 0 50px;
 }
 .type3 {
     margin: 0px 229px;
 }
.layui-input-inline{width: 214px !important}
</style>

<body>
 <!-- 内容主体区域 -->
 <div class="x-body layui-anim layui-anim-up">
  <div class="layui-fluid">
  
    <form class="layui-form layui-form-pane1" lay-filter="first" >

        <div class="layui-form-item"  id="img1">
            <label class="layui-form-label"></label>

            <div class="layui-input-inline">
                <div class="layui-upload-list">
                    <img class="layui-upload-img headImage type2" src="" id="demo1" width=400px height=260px>
                    <p id="demoText"></p>
                </div>
            </div>
        </div>

      <div class="layui-form-item">
          <div class="layui-inline">
          <label class="layui-form-label">产品名：</label>
              <div class="layui-input-inline type1" id="productName">
              </div>

      </div>

          <div class="layui-inline">
              <label class="layui-form-label">单位：</label>
              <div class="layui-input-inline type1" id="company">
              </div>
          </div>

      </div>
        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label">规格：</label>
                <div class="layui-input-inline type1" id="specifications">
                </div>
            </div>

            <div class="layui-inline">
                <label class="layui-form-label">数量：</label>
                <div class="layui-input-inline type1" id="movementQty">
                </div>
            </div>
        </div>
       <div class="layui-form-item">
           <div class="layui-inline">
               <label class="layui-form-label">进货价格：</label>
               <div class="layui-input-inline type1" id="purchaseCost">
               </div>
           </div>

           <div class="layui-inline">
               <label class="layui-form-label">生产日期：</label>
               <div class="layui-input-inline type1" id="dateOfManufacture">
               </div>
           </div>
       </div>

        <div class="layui-form-item">


            <div class="layui-inline">
                <label class="layui-form-label">出单时间：</label>
                <div class="layui-input-inline type1" id="createDate">
                </div>
            </div>

            <div class="layui-inline">
            <label class="layui-form-label">备注：</label>
            <div class="layui-input-inline type1" id="remark">
            </div>
            </div>
        </div>



        <div id="zyupload" class="zyupload"></div>

        <div class="layui-form-item" style="margin-left: 140px;">
            <!--<p id="btnGroup" class="pull-right">-->
                <!--<button class="layui-btn save"  lay-submit="" lay-filter="*" >保存</button>-->
                <button class="layui-btn quxiao type3" >关闭</button>
            <!--</p>-->
        </div>

        <input name="recordId"  class="recordId" type="hidden"  class="layui-input">


    </form>
  </div>
  </div>
  </body>
  </html>
<script type="text/javascript">



    //重新渲染表单

    function renderForm(){

        layui.use('form', function(){

            var form = layui.form;
            form.render();

        });

    }



    function child(data){
        var $ = layui.jquery;

        var recordId=data.recordId;
        $('#recordId').val(recordId);


        $.ajax({
            url:"/hy/basic/warehouse/queryWarehousingData",
            type:"get",
            data:{"recordId":recordId},
            dataType:"json",
            success:function(dataJson){
                console.log("+++"+JSON.stringify(dataJson));
                $("#productName").text(dataJson.data.product.productName);
                $("#company").text(dataJson.data.company.propertyName);
                $("#specifications").text(dataJson.data.specifications.propertyName);
                $("#movementQty").text(dataJson.data.ProductStockMovement.movementQty);
                $("#purchaseCost").text(dataJson.data.ProductStockMovement.purchaseCost);
                $("#dateOfManufacture").text(dataJson.data.ProductStockMovement.dateOfManufacture);
                $("#remark").text(dataJson.data.ProductStockMovement.remark);
                $("#createDate").text(dataJson.data.ProductStockMovement.createDate);
                $('#demo1').attr('src', ctx+dataJson.data.product.picUrl);
                if(dataJson.data.product.picUrl == null || dataJson.data.product.picUrl == "" ){
                    $("#img1").hide()
                }


                var selDom = $("#parentSeriesId");//根据id获取select的jquery对象


                renderForm();

            },
            error:function(){
                alert("驳回异常")
            }
        });


    }





    layui.use(['element', 'layer', 'jquery','form','laydate','upload'], function () {
        var form = layui.form;
        var $ = layui.jquery;
        var laydate=layui.laydate;
        /* function quxiao(){
            alert(111);
        } */
        var $ = layui.jquery,
            upload = layui.upload;

        form.on('submit(*)', function(data){
            console.log(data.field);

            var dataList = data.field;
            var service = {};


            service.recordId = dataList.recordId;
            service.memberName = dataList.memberName;
            service.tel = dataList.tel;
            service.gender = dataList.gender;
            service.weixin = dataList.weixin;
            service.birthday = dataList.birthday;
            service.zodiac = dataList.zodiac;
            service.memberGrade = dataList.memberGrade;
            service.bloodType = dataList.bloodType;
            service.height = dataList.height;
            service.weight = dataList.weight;
            service.lastDayOfMenses = dataList.lastDayOfMenses;
            service.cycleOfMenses = dataList.cycleOfMenses;
            service.periodOfMenses = dataList.periodOfMenses;
            service.remarkOfMenses = dataList.remarkOfMenses;
            service.profession = dataList.profession;
            service.address = dataList.address;
            service.email = dataList.email;

            service.memberCode = dataList.memberCode;
            service.introducer = dataList.introducer;
            service.primaryBeautician = dataList.primaryBeautician;



            if(dataList.recordStatus=='on'){
                service.recordStatus = 1
            }else{
                service.recordStatus = 0;
            }

            var url = '/hy/basic/member/addMember';
            var picList= $(".picList").val();
            $.ajax({
                type:'POST',
                url:url,
                data:{
                    condition:JSON.stringify(service),
                    picIdList:picList,
                    comeFrom:"PC"
                } ,
                contentType: "application/x-www-form-urlencoded",
                success: function(data){
                    alert("操作成功！");
                    window.parent.location.reload(); //刷新父页面
                    var index = parent.layer.getFrameIndex(window.name); //获取窗口索引
                    parent.layer.close(index);  // 关闭layer
                    /* alert("操作成功");
                    if(type=="update"){
                        window.parent.location.reload(); //刷新父页面
                        var index = parent.layer.getFrameIndex(window.name); //获取窗口索引
                        parent.layer.close(index);  // 关闭layer
                    }else{
                        window.location.reload();
                        //window.location.href="${basePath}ryOrderConfig/queryList";
                    } */

                    //window.location.href="${basePath}ryOrderConfig/queryList";
                },
                error:function(data){
                    alert("操作失败");
                    console.log(data);
                }
            })
            return false;
        });

    })


    layui.use('laydate', function() {
        var laydate = layui.laydate;
        //常规用法
        laydate.render({
            elem: '#lastDayOfMenses'
        });
        laydate.render({
            elem: '#birthday'
        });
    });





</script>  